//---------------------------------------------------------------------------

#ifndef CustomerDlgH
#define CustomerDlgH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include "CustomerBridge.h"
#include <Grids.hpp>
#include <Buttons.hpp>
#include <ExtCtrls.hpp>
#include <ComCtrls.hpp>
#include <ToolWin.hpp>


//---------------------------------------------------------------------------
class TfrmCustDlg : public TForm
{
__published:	// IDE-managed Components
        TPanel *pnlMain;
        TLabel *lblCustomerNo;
        TLabel *lblIDValue;
        TLabel *lblName;
        TEdit *edtName;
        TLabel *lblAddress;
        TEdit *edtPhone;
        TPanel *pnlCheckings;
        TToolBar *barMain;
        TToolButton *btnUpdate;
        TToolButton *btnAdd;
        TToolButton *btnDelete;
        TStringGrid *grdCheckings;
        TBitBtn *btnOk;
        TBitBtn *btnHelp;
        TBitBtn *btnCancel;
        TLabel *lblCustomerID;
        TEdit *edtCustomerID;
        TEdit *edtAddress;
        TLabel *Label1;
        TEdit *edtEmail;
        TLabel *lblEmail;
        TLabel *Label2;
        TEdit *edtLastName;
        void __fastcall btnOKClick(TObject *Sender);
        void __fastcall btnUpdateClick(TObject *Sender);
        void __fastcall btnAddClick(TObject *Sender);
        void __fastcall btnDeleteClick(TObject *Sender);
        void __fastcall FormDestroy(TObject *Sender);
        void __fastcall FormShow(TObject *Sender);
        void __fastcall grdCheckingsKeyDown(TObject *Sender, WORD &Key,
          TShiftState Shift);
private:	// User declarations
        bool isUpdate;
        TCustomerBridge * bridge;
        TStringList * checkings;

        void SetButtonsState();
        void RefreshGrid();
public:		// User declarations
        __fastcall TfrmCustDlg(TComponent* Owner, TCustomerBridge * bridge);
        __fastcall TfrmCustDlg(TComponent* Owner, TCustomerBridge * bridge, __int64 id, AnsiString customerID, AnsiString name, AnsiString customerLastName, AnsiString phone, AnsiString address, AnsiString email);
};
//---------------------------------------------------------------------------
extern PACKAGE TfrmCustDlg *frmCustDlg;
//---------------------------------------------------------------------------
#endif
